package com.angle3d;

/**
 * Class representing a shader source (such as vertex shader, geometry shader or fragment shader).
 * Note that geometry shaders are not supported in current implementation of OpenGL ES 2.0.
 * @author Alessandro Boccalatte
 */
public class ShaderSource {

	/**
	 * The shader type (one of vertex, geometry or fragment)
	 */
	public enum ShaderType {
		VERTEX,
		GEOMETRY,
		FRAGMENT
	}
	
	private final String mSource;
	private final ShaderType mType;
	
	/**
	 * Creates a shader source object for a given source (shader code) and type.
	 * @param source the shader source code
	 * @param type the shader type
	 */
	public ShaderSource(String source, ShaderType type) {
		mSource = source;
		mType = type;
	}
	
	/**
	 * Returns the shader source code.
	 * @return the shader source code.
	 */
	public String getSource() {
		return mSource;
	}
	
	/**
	 * Returns the shader type.
	 * @return the shader type.
	 */
	public ShaderType getType() {
		return mType;
	}
}

